<% for column in Machine.content_columns %>
<p>
  <b><%= column.human_name %>:</b> <%=h @machine.send(column.name) %>
</p>
<% end %>

<p>
	<b>Categories</b><br />
	<ul>
		<% unless @selected.length.zero? %>
			<% for cat in @selected %>
				<li><%=h cat %></li>
			<% end %>
		<% else  %>	
			<li>No Categories</li>
		<% end %>
	</ul>
</p>


<table>
  <tr>	
	<td width=45><b>Port</b></td>
	<td width=200><b>Service</b></td>
	<td width=75><b>State</b></td>
	<td width=300><b>Last Found</b></td>
  </tr>
<% for port_entry in @machine.port_entries.sort_by{|port_entry| port_entry.port_number} %>
<tr>	
	<td width=25><%=h port_entry.port_number %></td>
	<td width=200><%=h port_entry.service %></td>
	<td width=25><%=h port_entry.state %></td>
	<td width=150><%=h port_entry.last_time_found %></td>
  </tr>
<% end %>
</table>
<br>

<p>
	<b>Installed Applications</b><br />
	<ul>
		<% for application in @machine.installed_applications.sort_by{|application| application.name} %>
			<% unless application.name =~ /KB\d/ %>
				<li><%=h application.name %></li>
			<% end %>
		<% end %>
	</ul>
</p>

<%= link_to 'Edit', :action => 'edit', :id => @machine %> |
<%= link_to 'Destroy', { :action => 'destroy', :id => @machine }, :confirm => 'Are you sure you want to delete this entry ?', :post => true %>
<br /><br />
<%= link_to 'Back', :action => 'list' %>
